<?php
header("content-Type:text/html;charset=utf-8");

include 'link.php';
$i=$_POST["id"];

// $i=2;


$sql="DELETE FROM goods WHERE id=".$i;
$q=mysqli_query($link,$sql);
if($q){
    $arr=array("code"=>2,"msg"=>"删除成功");
    echo json_encode($arr);
}else{
    $arr=array("code"=>1,"msg"=>"无法删除，请检查数据或数据库");
    echo json_encode($arr);
}

?>